import { createApp } from 'vue'
import './assets/style/common.scss'
import App from './App.vue'

import router from './router'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as zhCn from 'element-plus/dist/locale/zh-cn.mjs' //element-plus
import * as ElementPlusIconsVue from '@element-plus/icons-vue' // 引入icon

// 引入组件
import svgIcon from './components/svgIcon.vue'
import BaiduMap from 'vue-baidu-map-3x' // 引入百度地图

// 挂载
const app = createApp(App)
const pinia = createPinia()
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, { locale: zhCn, size: 'small', zIndex: 3000 })
app.use(router)
app.use(pinia)

// 挂载到vue实例中
app.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'QM8Qm6r6vdcoHozPXg0CFvgU616WIA3D' // 百度ak
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
})
app.component('SvgIcon', svgIcon)

app.mount('#app')
